package com.baidu.health.controller;

import com.baidu.health.pojo.TbGoods;
import com.baidu.health.pojo.TbGoodsVo;
import com.baidu.health.service.TbGoodsService;
import com.baidu.health.util.ResultResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by IntelliJ IDEA.
 * User: 孙新超
 *
 * @author 孙新超
 * @version 1.0
 * @date To change this template use File | Settings | File Templates.
 * @date
 */
//商品信息
@Api(tags = "商品信息")
@RestController
@RequestMapping("/goods")
public class TbGoodsController {
    @Autowired
    private TbGoodsService service;
    @ApiOperation("全量添加")
    @PostMapping("fulladd")
    public ResultResponse fulladd(@RequestBody TbGoods tbGoods){
        return service.fulladd(tbGoods);
    }
    //增量添加
    @ApiOperation("增量添加")
    @PostMapping("add")
    public ResultResponse add(){
        return service.add();
    }
    //es列表
    @ApiOperation("es列表")
    @PostMapping("goodslist")
    public ResultResponse goodslist(@RequestBody TbGoodsVo tbGoodsVo){

        return service.goodslist(tbGoodsVo);
    }
    //商品订单表
    @ApiOperation("商品订单表")
    @PostMapping("goodsorderItem")
    public ResultResponse goodsorderItem(){

        return service.goodsorderItem();
    }
}
